package cn.stylefeng.guns.modular.student.web;


import java.time.LocalDateTime;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.stylefeng.guns.modular.student.entity.TbStudent;
import cn.stylefeng.guns.modular.student.service.ITbStudentService;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author kzwang
 * @since 2020-06-16
 */
@Controller
@RequestMapping("/student")
public class TbStudentAction {

	@Autowired
	private ITbStudentService studentService;

	@ResponseBody
	@RequestMapping("save")
	public TbStudent save() {
		TbStudent stu = new TbStudent();
		stu.setName("张三");
		stu.setSex("男");
		stu.setBirthday(LocalDateTime.now());
		studentService.save(stu);
		return stu;
	}
}
